﻿using MiniErp.Model.Entities;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace MiniErp.Repository.IRepository
{
    public interface IUsetInfoRepository
    {
        /// <summary>
        /// 增加用户信息
        /// </summary>
        /// <param name="userinfo">需要增加的一条数据</param>
        /// <returns></returns>
        Task<int> AddUserInfoAsync(UserInfoEntity userinfo);

        /// <summary>
        /// 删除用户信息
        /// </summary>
        /// <param name="id">用户工号</param>
        /// <returns></returns>
        Task<int> DeleteUserInfoAsync(int id);

        /// <summary>
        /// 更新用户信息
        /// </summary>
        /// <param name="userinfo">需要更新的一条数据</param>
        /// <returns>更新工号为userinfo.id的用户信息</returns>
        Task<int> UpdateUserInfoAsync(UserInfoEntity userinfo);


        /// <summary>
        /// 获取所有用户信息
        /// </summary>
        /// <returns>所有用户信息</returns>
        Task<IEnumerable<UserInfoEntity>> GetAllUserInfoAsync();

        /// <summary>
        /// 根据工号和密码获取单一用户信息
        /// </summary>
        /// <param name="id">用户工号</param>
        /// <param name="password">用户密码</param>
        /// <returns>工号为参数ID的用户信息</returns>
        Task<UserInfoEntity> GetUserInfoAsync(int id, string password);
        /// <summary>
        /// 查询该用户是否存在
        /// </summary>
        /// <param name="id">用户工号</param>
        /// <returns>查询到该工号存在的条数</returns>
        Task<int> GetUserisExistenceAsync(int id);
    }
}
